Skip to content

fix(ci): install SDK Python test deps in release workflows#3798

Closed
caio-pizzol wants to merge 1 commit into
mainfrom
caio-pizzol/release-python-test-deps
Closed

fix(ci): install SDK Python test deps in release workflows#3798
caio-pizzol wants to merge 1 commit into
mainfrom
caio-pizzol/release-python-test-deps

Conversation

@caio-pizzol

@caio-pizzol caio-pizzol commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The stable tooling release and SDK fallback release now install the Python test dependencies required by sdk-validate.mjs before SDK validation runs. The failed stable release had pytest missing, then fell through to the local uv fallback even though uv is not installed in the runner.

  • Installs build, pytest, and pytest-asyncio through python3 -m pip in release-stable and release-sdk Python setup, matching the interpreter used by python3 -m pytest.
  • Adds a workflow regression test that checks the dependencies are installed before the SDK validation paths.
  • PR CI validates the script/test surface, but it does not execute the stable release workflows themselves. The release-path proof here is workflow inspection, the new ordering test, and the existing green ci-sdk.yml pattern that already installs pytest pytest-asyncio before sdk-validate.mjs.
  • Current stable release state is half-complete: CLI 0.21.0 is already published and tagged, while SDK 1.20.0 has no tag or package. After this merges, rerun the stable tooling release so the orchestrator can skip the complete CLI release and retry SDK validation/publish with the Python test deps installed.

@caio-pizzol
caio-pizzol marked this pull request as ready for review July 5, 2026 18:42
@caio-pizzol
caio-pizzol requested a review from a team as a code owner July 5, 2026 18:42
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Brittle workflow ordering test 🐞 Bug ⚙ Maintainability
Description
The new release-order regression test hard-codes the full `python3 -m pip install build pytest
pytest-asyncio` command string, so non-semantic edits (adding pip flags, wrapping lines, or
reordering args) will fail CI even if dependencies are still installed before validation.
Code

packages/sdk/scripts/tests/release-order.test.mjs[R50-87]

+test('release workflows install Python SDK test dependencies before validation', async () => {
+  const installCommand = 'python3 -m pip install build pytest pytest-asyncio';
+
+  const releaseSdk = await readRepoFile('.github/workflows/release-sdk.yml');
+  const autoRelease = sectionBetween(
+    releaseSdk,
+    '  auto-release:',
+    '  sync-labs-agent:',
+    '.github/workflows/release-sdk.yml',
+  );
+  assertOrder(
+    autoRelease,
+    installCommand,
+    '- name: Run semantic-release',
+    '.github/workflows/release-sdk.yml auto-release',
+  );
+
+  const manualRelease = sectionBetween(
+    releaseSdk,
+    '  manual-release:',
+    '  testpypi-smoke:',
+    '.github/workflows/release-sdk.yml',
+  );
+  assertOrder(
+    manualRelease,
+    installCommand,
+    '- name: Validate SDK',
+    '.github/workflows/release-sdk.yml manual-release',
+  );
+
+  const stableRelease = await readRepoFile('.github/workflows/release-stable.yml');
+  assertOrder(
+    stableRelease,
+    installCommand,
+    '- name: Release stable packages (orchestrator)',
+    '.github/workflows/release-stable.yml',
+  );
+});
Relevance

⭐ Low

Repo’s release-order tests already hard-code exact workflow substrings; pattern merged unchanged in
PRs #2496 and #2908.

PR-#2496
PR-#2908

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test defines a single exact installCommand string and uses assertOrder to require that exact
substring to appear before subsequent workflow steps, which will break if the command text changes
even when behavior is unchanged.

packages/sdk/scripts/tests/release-order.test.mjs[50-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`release-order.test.mjs` asserts exact string equality on the full pip install command. This makes the test fragile: harmless changes to pip flags/formatting can break CI despite preserving the intended invariant (Python test deps installed before SDK validation paths).

### Issue Context
The intent is to enforce ordering (install deps before validation) and ensure the right tooling is present, not to enforce an exact command literal.

### Fix Focus Areas
- packages/sdk/scripts/__tests__/release-order.test.mjs[50-87]

### Suggested change
Update the test to assert more stable invariants, for example:
- Assert `- name: Install Python build and test tools` appears before the validation step(s) in the relevant workflow sections.
- Separately assert the section contains `python3 -m pip install` and contains `pytest` and `pytest-asyncio` (and `build` where needed), without requiring the full command string to match exactly.
This keeps the regression coverage while avoiding false failures on benign workflow refactors.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@superdoc-bot

superdoc-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This pull request landed on main as b4ec138.

@superdoc-bot superdoc-bot Bot closed this in b4ec138 Jul 5, 2026
@superdoc-bot

superdoc-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-sdk v1.20.0

@superdoc-bot

superdoc-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/mcp v0.16.0

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant